@echo off&setlocal enabledelayedexpansion

set /a p[1]=10
set /a p[2]=90
set /a p[3]=13
set /a p[4]=20
set /a p[5]=3
set /a p[6]=23
set /a p[7]=1

for /L %%i in (1,1,6) do (
    set /a start_num=%%i+1
	for /L %%k in (!start_num!,1,7) do (
		if !p[%%i]! GTR !p[%%k]! (
			set /a tmp=!p[%%i]!
			set /a p[%%i]=!p[%%k]!
			set /a p[%%k]=!tmp!
		)
	)
)

for /L %%a in (1,1,7) do (echo !p[%%a]!)
pause
exit